﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Wild2.Models.Pages.Office.Profile>" %>
<% Html.BeginForm(); %>
<div class="elb" style="padding: 0.4em">
    Укажите пол<br />
    <%= Html.DropDownList("male", new List<SelectListItem> { 
        new SelectListItem() { Text = "Не указан", Value = "null", Selected = (Model.isMale.HasValue == false) }, 
        new SelectListItem() { Text = "Я мужчина", Value = "male", Selected = (Model.isMale.HasValue && Model.isMale.Value == true) }, 
        new SelectListItem() { Text = "Я женщина", Value = "female", Selected = (Model.isMale.HasValue && Model.isMale.Value == false) } })%>
</div>
<div class="elb" style="padding: 0.4em">
    Выберите дату рождения<br />
    <% 
       List<SelectListItem> days = new List<SelectListItem>();
       days.Add(new SelectListItem() { Text = "Не указан", Value = "0" });
       for (int i = 1; i <= 31; i++)
       {
           SelectListItem day = new SelectListItem();
           day.Text = i.ToString();
           day.Value = i.ToString();
           if (Model.birth.HasValue) day.Selected = (Model.birth.Value.Day == i);
           days.Add(day);
       } %>
    День: <%= Html.DropDownList("day", days)%>
    <br />
    <% 
       List<SelectListItem> months = new List<SelectListItem>();
       months.Add(new SelectListItem() { Text = "Не указан", Value = "0" });
       for (int i = 1; i <= 12; i++)
       {
           SelectListItem month = new SelectListItem();
           month.Text = i.ToString();
           month.Value = i.ToString();
           if (Model.birth.HasValue) month.Selected = (Model.birth.Value.Month == i);
           months.Add(month);
       } %>
    Месяц: <%= Html.DropDownList("month", months)%>
    <br />
    <% 
       List<SelectListItem> years = new List<SelectListItem>();
       years.Add(new SelectListItem() { Text = "Не указан", Value = "0" });
       for (int i = 2005; i >= 1950; i--)
       {
           SelectListItem year = new SelectListItem();
           year.Text = i.ToString();
           year.Value = i.ToString();
           if (Model.birth.HasValue) year.Selected = (Model.birth.Value.Year == i);
           years.Add(year);
       } %>
    Год: <%= Html.DropDownList("year", years)%>
</div>
<div class="elb" style="padding: 0.4em">
    Ваш ключ авторизации<br />
    <%= Html.TextBox("key", Model.key, new { style = "width:95%", @readonly = "readonly" })%>
</div>
<div class="elb" style="padding: 0.4em">
    Укажите ваш E-Mail<br />
    <%= Html.TextBox("email", Model.email, new { style = "width:95%" })%>
</div>
<div class="elb" style="padding: 0.4em">
    <input type="submit" name="save" value="Сохранить" />
</div>
<% Html.EndForm(); %>
